﻿using System.Collections.Generic;
using EP.Base.BaseService.Manager.Model;

namespace EP.Base.BaseService.Manager.Interface
{
    public interface IEsData
    {
        /// <summary>
        /// 根据别名获取所有关联索引
        /// </summary>
        /// <param name="esHosts"></param>
        /// <param name="alias"></param>
        /// <returns></returns>
        string[] GetAllIndexByAlias(IEnumerable<string> esHosts, string alias);
        /// <summary>
        /// 根据索引前缀或别名获取所有关联索引
        /// </summary>
        /// <param name="esHosts"></param>
        /// <param name="indexPreOrAlias">索引前缀（indexname-*）或别名（indexalias）</param>
        /// <returns></returns>
        string[] GetAllIndexByIndexPreFixOrAlias(IEnumerable<string> esHosts, string indexPreOrAlias);
        /// <summary>
        /// 删除索引
        /// </summary>
        /// <param name="esHosts"></param>
        /// <param name="indexName"></param>
        /// <returns></returns>
        bool DeleteIndex(IEnumerable<string> esHosts, string indexName);

        /// <summary>
        /// 快照多个索引
        /// </summary>
        /// <param name="esHosts"></param>
        /// <param name="repository"></param>
        /// <param name="snapshotName"></param>
        /// <param name="index"></param>
        bool Snapshot(IEnumerable<string> esHosts, string repository, string snapshotName, IEnumerable<string> index);

        /// <summary>
        /// 删除快照
        /// </summary>
        /// <param name="esHosts"></param>
        /// <param name="repository"></param>
        /// <param name="snapshotName"></param>
        bool DeleteSnapshot(IEnumerable<string> esHosts, string repository, string snapshotName);
        /// <summary>
        /// 获取快照信息
        /// </summary>
        /// <param name="esHosts"></param>
        /// <param name="repository"></param>
        /// <param name="snapshotName"></param>
        /// <returns></returns>
        EsSnapshotInfo GetSnapshotInfo(IEnumerable<string> esHosts, string repository, string snapshotName);
    }
}
